package com.mszl.blog.vo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor//必须要有无参构造，反序列化

public class Result {
    private boolean success;
    private int code;
    private String msg;
    private  Object data;

    public Result(boolean success, int code, String msg, Object data1) {
        this.success = success;
        this.code = code;
        this.msg = msg;
        this.data = data1;
    }

    public  static  Result success(Object data1){
        return new Result(true,200,"success",data1);

    }
    public static Result fail(int code,Object msg1){
        return new Result(false,code,(String) msg1,null);

    }


}
